<?php

namespace common\models\buss;

use Yii;

/**
 * This is the model class for table "{{%buss_doctors}}".
 *
 * @property int $id
 * @property int $project_id 项目
 * @property string $name 医生名称
 * @property string $pop_stars 推广星级
 * @property string $hospital_name 医院名称
 * @property string $type 医生类型【1：三甲、2：二甲、3：民营】
 * @property int $operation_id 操作人ID
 * @property string $operation_name 操作人
 * @property int $status 状态【-1：删除、0：禁用、1：启用】
 * @property int $created_at 添加时间
 * @property int $updated_at 更新时间
 */
class Doctors extends \common\models\base\BaseModel
{
    const STATUS_DELETE = -1;// 删除
    const STATUS_INVALID = 0;// 禁用
    const STATUS_ENABLE = 1;// 正常

    const POP_STARS_ONE = 1;// 一星
    const POP_STARS_TWO = 2;// 二星
    const POP_STARS_THREE = 3;// 三星
    const POP_STARS_FOUR = 4;// 四星
    const POP_STARS_FIVE = 5;// 五星

    const TYPE_A = 1;// 三甲
    const TYPE_B = 2;// 二甲
    const TYPE_PRIVATE = 3;// 民营

    public static $statuss = [
        self::STATUS_DELETE => '删除',
        self::STATUS_INVALID => '停用',
        self::STATUS_ENABLE => '正常',
    ];
    public static $popStars = [
        self::POP_STARS_ONE => '一星',
        self::POP_STARS_TWO => '二星',
        self::POP_STARS_THREE => '三星',
        self::POP_STARS_FOUR => '四星',
        self::POP_STARS_FIVE => '五星',
    ];
    public static $types = [
        self::TYPE_A => '三甲',
        self::TYPE_B => '二甲',
        self::TYPE_PRIVATE => '民营',
    ];
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%buss_doctors}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['project_id', 'name', 'type'], 'required'],
            [['project_id', 'operation_id', 'status', 'created_at', 'updated_at'], 'integer'],
            [['name', 'hospital_name', 'type', 'operation_name'], 'string', 'max' => 100],
            [['pop_stars'], 'string', 'max' => 30],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'project_id' => '项目',
            'name' => '医生名称',
            'pop_stars' => '推广星级',
            'hospital_name' => '医院名称',
            'type' => '医生类型【1：三甲、2：二甲、3：民营】',
            'operation_id' => '操作人ID',
            'operation_name' => '操作人',
            'status' => '状态【-1：删除、0：禁用、1：启用】',
            'created_at' => '添加时间',
            'updated_at' => '更新时间',
        ];
    }
}
